<template>
    <view>
        <view class="first">
            <view class="article">
                <view class="txt" v-if="type==='用户协议'">
                    <rich-text :nodes="obj.registration_agreement.contents"></rich-text>
                </view>
                <view class="txt" v-else-if="type==='隐私政策'">
                    <rich-text :nodes="obj.privacy_policy.contents"></rich-text>
                </view>
            </view>
        </view>
    </view>
</template>
<script>
import { userNotice } from '@/utils/request.js'
export default {
    data() {
        return {
            obj:{},
            type: ''
        }
    },
    onLoad(option) {
        this.type=option.type
        uni.setNavigationBarTitle({
            title: option.type
        });
        this.getInit()
    },
    methods: {
        async userNotice() {
            return await userNotice()
        },
        getInit() {
            userNotice().then(res => {
                this.obj=res
            })
        }
    }
}
</script>
<style lang="scss" scoped>
.first {
    margin-bottom: 52rpx;

    .head {
        text-align: center;

        image {
            width: 538rpx;
            height: 44rpx;
            margin: 0 auto 26rpx;
        }
    }

    .article {
        width: 92%;
        margin: 0 auto;
        padding: 30rpx 0;
        .txt {
            font-size: 22rpx;
            font-family: PingFang SC;
            font-weight: 400;
            line-height: 44rpx;
            color: #1A1A1A;
        }
    }
}
</style>